import axios from '@/libs/api.request'
export default class dataApi {
  /**
   * 客户信息列表查询接口
   */
  static postCustomerList = params => {
    return axios.request({
      url: '/Customer/List',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取合计数据
   */
  static CountInfo = params => {
    return axios.request({
      url: '/Customer/CountInfo',
      method: 'get',
      params: params
    })
  }

  /**
   * 数据字典接口
   */
  static getEnum = params => {
    return axios.request({
      url: '/Enum/Enum',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 数据字典-用工形式
   */
  static getSelectValueList = params => {
    return axios.request({
      url: '/SysBasedata/GetSelectValueList',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 查询所有省
   */
  static getProvince = params => {
    return axios.request({
      url: '/SysArea/GetProvince',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 查询当前省的市
   */
  static getCity = params => {
    return axios.request({
      url: '/SysArea/GetCity',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 查询当前市下面的区和县
   */
  static getArea = params => {
    return axios.request({
      url: '/SysArea/GetArea',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 新增第一个接口 客户基本信息
   */
  static postCustomer = params => {
    return axios.request({
      url: '/Customer/PostCustomer',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 新增第二个接口 营业执照信息
   */
  static postLicense = params => {
    return axios.request({
      url: '/Customer/PostLicense',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 新增第四个接口 合同信息上传附件
   */
  static postContract = (params, id) => {
    return axios.request({
      url: '/Customer/' + id + '/PostContract',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取所属客服下拉数据
   */
  static postServers = params => {
    return axios.request({
      url: '/Enum/Servers',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取付款单位
   */
  static getPayeeCompany = params => {
    return axios.request({
      url: '/Customer/DefaultCustomerPayInfo',
      method: 'get',
      params: params
    })
  }

  /**
   * 获取申报单位下拉数据
   */
  static getUnitList = params => {
    return axios.request({
      url: '/DeclareUnit/GetUnitList',
      method: 'get',
      params: params
    })
  }

  /**
   * 获取上级公司下拉数据
   */
  static postCompanys = params => {
    return axios.request({
      url: '/Enum/Companys',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取参保编号列表
   */
  static getSecurityNoList = params => {
    return axios.request({
      url: '/SysWelfarePercentNoConfig/GetSecurityNoList',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 参保信息新增
   */
  static postInsuranceCode = params => {
    return axios.request({
      url: '/Customer/PostInsuranceCode',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 恢复合作
   */
  static resumeCooperate = (params, id) => {
    return axios.request({
      url: '/Customer/' + id + '/ResumeCooperate',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data',
      // headers: {
      //   'content-type': 'multipart/form-data'
      // }
    })
  }
  /**
   * 上传附件
   */
  static postUpload = (params, id) => {
    return axios.request({
      url: '/Customer/' + id + '/Upload',
      method: 'post',
      data: params,
      headers: {
        'content-type': 'multipart/form-data'
      }
    })
  }

  /**
   * 客户工资发放日期
   */
  static getPayDays = (params, id) => {
    return axios.request({
      url: '/Customer/PayDays',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 添加或者修改费用信息
   */

  static postChargeInfo = params => {
    return axios.request({
      url: '/Customer/PostChargeInfo',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 终止合同
   */
  static postTerminateContract = params => {
    return axios.request({
      url: '/Customer/TerminateContract',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 单位调离
   */
  static postReassignServer = params => {
    return axios.request({
      url: '/Customer/ReassignServer',
      method: 'post',
      data: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取客户基本信息
   */
  static getSingle = params => {
    return axios.request({
      url: '/Customer/Single',
      method: 'get',
      params: params
    })
  }

  /**
   * 获取客户营业执照信息
   */
  static getLicense = params => {
    return axios.request({
      url: '/Customer/License',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取客户费用信息
   */
  static getChargeInfo = params => {
    return axios.request({
      url: '/Customer/ChargeInfo',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取客户合同信息
   */
  static getContracts = params => {
    return axios.request({
      url: '/Customer/Contracts',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取客户参保编号
   */
  static getInsuranceCodes = params => {
    return axios.request({
      url: '/Customer/InsuranceCodes',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取工资发放日期
   */
  static getPayDaysList = params => {
    return axios.request({
      url: '/Customer/PayDaysList',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 获取客户附件列表
   */
  static getAttachments = params => {
    return axios.request({
      url: '/Customer/Attachments',
      method: 'get',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  /**
   * 下载附件
   */
  static getDownLoadAttachment = params => {
    return axios.request({
      url: '/Customer/DownLoadAttachment',
      method: 'get',
      params: params,
      responseType: 'blob'
    })
  }

  // 导出客户
  static ExportCustomers = params => {
    return axios.request({
      url: '/Customer/ExportCustomers',
      method: 'post',
      data: params
    })
  }

  // 删除参保信息
  static DeleteInsuranceCode = params => {
    return axios.request({
      url: '/Customer/DeleteInsuranceCode',
      method: 'delete',
      params: params,
      enctype: 'multipart/form-data'
    })
  }

  // 获取银行账户信息
  static customerPayInfo = params => {
    return axios.request({
      url: '/Customer/CustomerPayInfo',
      method: 'get',
      params: params
    })
  }

  // 获取合同编号
  static getDefaultContractNo = params => {
    return axios.request({
      url: '/Customer/GetDefaultContractNo',
      method: 'get',
      params: params
    })
  }

  // 获取营业执照
  static getLicenseAttachments = params => {
    return axios.request({
      url: '/Customer/GetLicenseAttachments',
      method: 'get',
      params: params
    })
  }

  // 删除附件
  static deleteAttachments = params => {
    return axios.request({
      url: '/Customer/DeleteAttachment',
      method: 'delete',
      params: params
    })
  }

  // 删除合同
  static DeleteContract = params => {
    return axios.request({
      url: '/Customer/DeleteContract',
      method: 'delete',
      params: params
    })
  }

  // 获取相应下拉数据
  static GetSelectIdList  = params => {
    return axios.request({
      url: 'SysBasedata/GetSelectIdList',
      method: 'get',
      params: params
    })
  }
}
